From 4a56161e24aeecdc5bfb35ce12b62d75e5c62982 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 5 Apr 2004 04:02:04 +0000 Subject: [PATCH] Add $wgCapitalLinks option; if set to false, titles won't be forced to have an initial capital. This isn't recommended in general, as it will make "[[Asteroid]]s are..." and "... like [[asteroid]]s." point to different pages. It is meant mainly for languages which use the latin alphabet but don't capitalize at sentence start (mainly conlangs) or for special purposes where this is needed. This can *break links* and should not be changed on an existing wiki without careful attention. --- includes/DefaultSettings.php | 8 ++++++++ includes/Title.php | 8 +++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index d731b011c2..143b74924e 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -305,4 +305,12 @@ $wgEnableCreativeCommonsRdf = false; $wgRightsPage = NULL; $wgRightsUrl = NULL; $wgRightsText = NULL; + +# Set this to false to avoid forcing the first letter of links +# to capitals. WARNING: may break links! This makes links +# COMPLETELY case-sensitive. Links appearing with a capital at +# the beginning of a sentence will *not* go to the same place +# as links in the middle of a sentence using a lowercase initial. +$wgCapitalLinks = true; + ?> diff --git a/includes/Title.php b/includes/Title.php index b5f2a6e7ba..a5a80159f7 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -580,7 +580,7 @@ class Title { # /* private */ function secureAndSplit() { - global $wgLang, $wgLocalInterwiki; + global $wgLang, $wgLocalInterwiki, $wgCapitalLinks; $fname = "Title::secureAndSplit"; wfProfileIn( $fname ); @@ -674,8 +674,10 @@ class Title { } # Initial capital letter - if( $this->mInterwiki == "") $t = $wgLang->ucfirst( $r ); - + if( $wgCapitalLinks && $this->mInterwiki == "") { + $t = $wgLang->ucfirst( $r ); + } + # Fill fields $this->mDbkeyform = $t; $this->mUrlform = wfUrlencode( $t ); -- 2.20.1